package compositePattern

/**
 * 树枝结点
 */
class ConcreteCompany(private val name: String, private val position: String) : Company {
    override fun getInfo(): String {
        return "姓名:$name 职位:$position"
    }

    private val companyList = arrayListOf<Company>()

    fun add(company: Company) {
        companyList.add(company)
    }

    fun remove(company: Company) {
        companyList.remove(company)
    }

    fun getChild(): ArrayList<Company> {
        return companyList
    }
}